package com.gitee.ywj1352.order.controller;

import com.gitee.ywj1352.order.service.IOrderService;
import io.seata.core.context.RootContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class OrderController {


    @Autowired
    IOrderService orderService;


    @GetMapping("/order")
    public String createOrder(@RequestParam("userId") Long userId){
        String xid = RootContext.getXID();
        System.out.println("全局xid = " + xid);
        orderService.addOrder(null,userId);
        return "OK";
    }

}
